package com.aaa.hospital.conver;

import com.aaa.hospital.pojo.domain.Dept;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * @Author: danghui
 * @Date: 2022/2/21 16:15
 * @Description: TODO
 */
public class PostConverter implements Converter<Dept> {
    @Override
    public Class supportJavaTypeKey() {
        return Dept.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public Dept convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return null;
    }
    /**你的数据中有一个clerk，是一个对象，里面的哪一个内容展示到excel表格中*/
    @Override
    public CellData convertToExcelData(Dept dept, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return new CellData( dept.getDname());
    }
}
